﻿using API_Service;
using API_Service.BizLogic.BasicData;
using API_Service.BizLogic.Bom;
using Nancy;
using System;
using System.Collections.Generic;
using System.Web;

namespace API_Service.Module
{
    public class OutputPlanModule : BaseAPIModule
    {
        private OutputPlanService outputPlanService = new OutputPlanService();

        public OutputPlanModule(): base("/outputplan")
        {
            Get["/"] = _ => Response.AsJson("产能资料维护");

            #region 产能资料维护

            //目标产能清单
            Get["/list"] = p =>
            {
                return Response.AsJson(outputPlanService.GetOutputData());
            };
            //VV
            Post["/save"] = _ =>
            {
                string model = Request.Form["MODEL"];

                return Response.AsJson(outputPlanService.SaveOutput(model));
            };

            #endregion

        }

    }
}